<script type="text/javascript">
	$(function(){
		$("#form").validate({
			rules: 
			{
				title: 
				{ 
					required: true
				},
				detail: 
				{ 
					required: true
				}
			},
			messages:
			{
				title: 
				{ 
					required: "กรุณากรอกคำถามค่ะ"
				},
				detail: 
				{ 
					required: "กรุณากรอกรายละเอียดค่ะ"
				}
			}
		});
	});
</script>

<ul id="breadcrumb">
	<li><a href="question">ถาม - ตอบ</a></li>
	<li>ตั้งคำถาม</li>			
</ul>
<div id="content">
	<form id="form" action="question/save" method="post">
	<table class="form">
		<tr>
			<th>คำถาม<span class="require">*</span></th>
			<td><?php echo form_input('title',$rs['title'],'style="width:600px;"') ?></td>
		</tr>
		<tr>
			<th>รายละเอียด<span class="require">*</span></th>
			<td><?php echo form_textarea('detail',$rs['detail'],'style="width:600px;"') ?></td>
		</tr>
		<tr>
			<th></th>
			<td>
				<input class="button" type="submit" value="ตั้งคำถาม" />
				<input class="button" type="button" value="<?php echo lang('btn_back')?>"  onclick="window.location = 'question'" />
				<input type="hidden" name="id" value="<?php echo $rs['id'] ?>" />
				<input type="hidden" name="<?php echo ($rs['id'])?'updated':'created' ?>" value="<?php echo time() ?>" />
			</td>
		</tr>
	</table>
	</form>
</div>
